﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;

namespace WebParafarmacia
{
    public partial class ProductoDetalle : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
       SqlConnection conn = new SqlConnection();

        conn.ConnectionString = "Data Source=ROMLAPTOP\\SQLEXPRESS;Initial Catalog=dbParafarmacia;Integrated Security=True";
        string sCmdText = "Select * from tblProducto where id=" + Request.QueryString["idProducto"];

       SqlCommand sCommand = new SqlCommand(sCmdText,conn);

       SqlDataAdapter daProducto = new SqlDataAdapter(sCmdText,conn);
       System.Data.DataSet ds = new System.Data.DataSet();
        daProducto.Fill(ds);
        
        System.Data.DataRow dr =  ds.Tables[0].Rows[0];
        lblNombre.Text = dr["NombreProducto"].ToString();
        lblDescripcion.Text = dr["Descripcion"].ToString();
        lblPrecio.Text = dr["Precio"].ToString();
               
        }
    }
}